/*
 * BLinkBikePed.java
 *
 * Copyright 2008 David D. Emory
 * 
 * This file is part of Five Points. See <http://www.fpdev.org> for
 * additional information regarding the project.
 * 
 * Five Points is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Five Points is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Five Points.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.fpdev.core.basenet;

import java.awt.*;
import org.fpdev.core.Scenario;
import org.fpdev.core.transit.TransitPath;
import org.fpdev.apps.rtemaster.gui.map.MapCanvas;

/**
 * The BLink implementation for a bike/pedestrian facility.
 * 
 * @author demory
 */
public class BLinkBikePed extends BLink {

  private int type_;

  public BLinkBikePed(Scenario s, int id, BNode fNode, BNode tNode, String dispName, int lenFt) {
    super(s, id, fNode, tNode, dispName, lenFt);
    type_ = LinkTypes.BP_GENERAL;
  }

  public BLinkBikePed(BLink link) {
    super(link);
    type_ = LinkTypes.BP_GENERAL;
  }

  public int getType() {
    return type_;
  }

  public int getClassType() {
    return BLink.CLASS_BIKEPED;
  }

  @Override
  public void drawBG(MapCanvas canvas,Scenario scen) { }

  @Override
  public void drawFG(MapCanvas canvas,Scenario scen) {
    canvas.setColor(new Color(47, 127, 0));
    float[] dash = {3, 2};
    canvas.setStroke(new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, dash, 0));
    super.drawCurve(canvas);
  }

  @Override
  public int getDrawWidth(MapCanvas canvas,Scenario scen) {
    return 3;
  }

  @Override
  public boolean isWalkable() {
    return true;
  }

  @Override
  public boolean isBikeable(BNode start) {
    return true;
  } //!isStation(); }

  @Override
  public boolean supportsTransitType(TransitPath.Type type, Scenario scen, BaseNetwork baseNet) {
    return false;
  }
}
























